package com.example.manager;

import com.example.entity.OrderMain;
import com.example.mapper.OrderMainMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

/**
 * 订单主表 通用业务处理层
 * @author CodeGenerator
 * @date 2025-08-30
 */
@Component
public class OrderMainManager {

    @Autowired
    private OrderMainMapper orderMainMapper;

    /**
     * 新增
     */
    public int insert(OrderMain orderMain) {
        return orderMainMapper.insertSelective(orderMain);
    }

    /**
     * 更新
     */
    public int update(OrderMain orderMain) {
        return orderMainMapper.updateByPrimaryKeySelective(orderMain);
    }

    /**
     * 删除
     */
    public int deleteById(Integer id) {
        return orderMainMapper.deleteByPrimaryKey(id);
    }

    /**
     * 根据ID查询
     */
    public OrderMain selectById(Integer id) {
        return orderMainMapper.selectByPrimaryKey(id);
    }

    /**
     * 查询所有
     */
    public List<OrderMain> selectAll() {
        return orderMainMapper.selectAll();
    }
}

